package pk.campustour;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;


public class HomeActivity extends Activity {
	public ViewFlipper viewFlipper=null;
	int gallery_grid_Images[]={R.drawable.chep,R.drawable.ir,R.drawable.iqtm,R.drawable.biotech};

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        
        TextView tv1 = (TextView) findViewById(R.id.CameraViewText);
        Typeface face = Typeface.createFromAsset(getAssets(),
                    "fonts/Stroke.ttf");
        tv1.setTypeface(face);
        
        TextView tv2 = (TextView) findViewById(R.id.SearchViewText);
        Typeface face2 = Typeface.createFromAsset(getAssets(),
                    "fonts/Stroke.ttf");
        tv2.setTypeface(face2);
        
        viewFlipper = (ViewFlipper)findViewById(R.id.flipper);
        for(int i=0;i<gallery_grid_Images.length;i++)
        {
        	//  This will create dynamic image view and add them to ViewFlipper
        	setFlipperImage(gallery_grid_Images[i]);
        }	

    }
    private void setFlipperImage(int res) {
        Log.i("Set Filpper Called", res+"");
        ImageView image = new ImageView(getApplicationContext());
        image.setBackgroundResource(res);
        viewFlipper.addView(image);
    }
    public void callSearch(View view)
    {
    	//Toast.makeText(PhotosActivity.this,"Search Activity.!!! " , Toast.LENGTH_SHORT).show();
    	Intent intent=new Intent(HomeActivity.this,Map.class);
    	startActivity(intent);
    }
    public void callCamera(View view)
    {
    	//Toast.makeText(PhotosActivity.this,"Camera Activity.!!! " , Toast.LENGTH_SHORT).show();
    	Intent intent=new Intent(HomeActivity.this,CameraActivity.class);
    	startActivity(intent);
    }
}